using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Multivariate
{
    /// <summary>
    /// <para>Class Probability</para>
    /// <para>Creates a multiband raster of probability bands, with one band being created for each class represented in the input signature file.</para>
    /// <para>创建概率波段的多波段栅格，为输入特征文件中表示的每个类创建一个波段。</para>
    /// </summary>    
    [DisplayName("Class Probability")]
    public class ClassProbability : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ClassProbability()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster_bands">
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>They can be integer or floating point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>它们可以是整数类型或浮点类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_signature_file">
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>Input signature file whose class signatures are used to generate the a priori probability bands.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入签名文件，其类签名用于生成先验概率带。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_multiband_raster">
        /// <para>Output multiband raster</para>
        /// <para><xdoc>
        ///   <para>The output multiband raster dataset.</para>
        ///   <para>It will be of integer type.</para>
        ///   <para>If the output is an Esri Grid, the filename cannot have more than 9 characters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出多波段栅格数据集。</para>
        ///   <para>它将是整数类型。</para>
        ///   <para>如果输出是 Esri Grid，则文件名不能超过 9 个字符。</para>
        /// </xdoc></para>
        /// </param>
        public ClassProbability(List<object> _in_raster_bands, object _in_signature_file, object _out_multiband_raster)
        {
            this._in_raster_bands = _in_raster_bands;
            this._in_signature_file = _in_signature_file;
            this._out_multiband_raster = _out_multiband_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Class Probability";

        public override string CallName => "sa.ClassProbability";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster_bands, _in_signature_file, _out_multiband_raster, _maximum_output_value, _a_priori_probabilities.GetGPValue(), _in_a_priori_file];

        /// <summary>
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>They can be integer or floating point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>它们可以是整数类型或浮点类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster bands")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_raster_bands { get; set; }


        /// <summary>
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>Input signature file whose class signatures are used to generate the a priori probability bands.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入签名文件，其类签名用于生成先验概率带。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input signature file")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_signature_file { get; set; }


        /// <summary>
        /// <para>Output multiband raster</para>
        /// <para><xdoc>
        ///   <para>The output multiband raster dataset.</para>
        ///   <para>It will be of integer type.</para>
        ///   <para>If the output is an Esri Grid, the filename cannot have more than 9 characters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出多波段栅格数据集。</para>
        ///   <para>它将是整数类型。</para>
        ///   <para>如果输出是 Esri Grid，则文件名不能超过 9 个字符。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output multiband raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_multiband_raster { get; set; }


        /// <summary>
        /// <para>Maximum output value</para>
        /// <para><xdoc>
        ///   <para>Factor for scaling the range of values in the output probability bands.</para>
        ///   <para>By default, the values range from 0 to 100.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于缩放输出概率区间中值范围的因子。</para>
        ///   <para>默认情况下，值的范围为 0 到 100。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum output value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _maximum_output_value { get; set; } = 100;


        /// <summary>
        /// <para>A priori probability weighting</para>
        /// <para><xdoc>
        ///   <para>Specifies how a priori probabilities will be determined.</para>
        ///   <bulletList>
        ///     <bullet_item>Equal— All classes will have the same a priori probability.</bullet_item><para/>
        ///     <bullet_item>Sample— A priori probabilities will be proportional to the number of cells in each class relative to the total number of cells sampled in all classes in the signature file.</bullet_item><para/>
        ///     <bullet_item>File—The a priori probabilities will be assigned to each class from an input ASCII a priori probability file.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何确定先验概率。</para>
        ///   <bulletList>
        ///     <bullet_item>相等 - 所有类将具有相同的先验概率。</bullet_item><para/>
        ///     <bullet_item>样本 — 先验概率将与每个类中的像元数相对于签名文件中所有类中采样的像元总数成正比。</bullet_item><para/>
        ///     <bullet_item>文件 - 先验概率将从输入 ASCII 先验概率文件分配给每个类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("A priori probability weighting")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _a_priori_probabilities_value _a_priori_probabilities { get; set; } = _a_priori_probabilities_value._EQUAL;

        public enum _a_priori_probabilities_value
        {
            /// <summary>
            /// <para>Equal</para>
            /// <para>Equal— All classes will have the same a priori probability.</para>
            /// <para>相等 - 所有类将具有相同的先验概率。</para>
            /// </summary>
            [Description("Equal")]
            [GPEnumValue("EQUAL")]
            _EQUAL,

            /// <summary>
            /// <para>Sample</para>
            /// <para>Sample— A priori probabilities will be proportional to the number of cells in each class relative to the total number of cells sampled in all classes in the signature file.</para>
            /// <para>样本 — 先验概率将与每个类中的像元数相对于签名文件中所有类中采样的像元总数成正比。</para>
            /// </summary>
            [Description("Sample")]
            [GPEnumValue("SAMPLE")]
            _SAMPLE,

            /// <summary>
            /// <para>File</para>
            /// <para>File—The a priori probabilities will be assigned to each class from an input ASCII a priori probability file.</para>
            /// <para>文件 - 先验概率将从输入 ASCII 先验概率文件分配给每个类。</para>
            /// </summary>
            [Description("File")]
            [GPEnumValue("FILE")]
            _FILE,

        }

        /// <summary>
        /// <para>Input a priori probability file</para>
        /// <para><xdoc>
        ///   <para>A text file containing a priori probabilities for the input signature classes.</para>
        ///   <para>An input for the a priori probability file is only required when the File option is used.</para>
        ///   <para>The extension for the a priori file can be .txt or .asc.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含输入签名类的先验概率的文本文件。</para>
        ///   <para>仅当使用 File 选项时，才需要先验概率文件的输入。</para>
        ///   <para>先验文件的扩展名可以是 .txt 或 .asc。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input a priori probability file")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_a_priori_file { get; set; } = null;


        public ClassProbability SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}